<?php /* Smarty version 2.6.18, created on 2016-12-30 16:53:32
         compiled from notice/family.add.tpl.php */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.header.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.left.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
  <!--主要内容开始-->
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
        <section class="col-lg-12 connectedSortable">
         <div class="box box-default box-solid">
             <form name="myform" method="post" action=""  enctype="multipart/form-data">	
                <div class="box-header with-border">
                    <span class="fa fa-volume-up" style="float:left; font-size:18px; padding-top:3px; color:#3c8dbc;" ></span>
                    <p class="box-title">家长写信</p>
					
                </div>
                <div class="box-body">
                    <div class="form-group">
						  <label for="inputPassword3" class="col-md-1 col-xs-4 control-label" style="padding:0;">
							   标题：
						  </label>
						  <div class="input-group col-sm-3 col-xs-4" style="padding:0;">
							   <input type="text" class="form-control" name="notice_title"> 
						  </div>
				    </div>
					<div class="form-group">
						  <label for="inputPassword3" class="col-md-1 col-xs-4 control-label" style="padding:0;">
							   发送给：
						  </label>
						  <div class="input-group col-sm-3 col-xs-4" style="padding:0;">
							   <label class="choice"><input type="radio" name="notice_to" value='1' checked> 班主任</label>
							   <label class="choice"><input type="radio" name="notice_to" value="0"> 学校</label>
						  </div>
				    </div>
                    <div class="form-group">
						 <label for="inputPassword3" class="col-md-1 control-label" style="padding:0;">
							   内容：
						  </label>
				         <div class="input-group col-sm-10 col-xs-10">
						   <textarea id="category_content" name="notice_content" rows="22" cols="40" style="width: 100%"></textarea>
					    </div>
					</div> 
					<div class="form-group">
						  <label for="inputPassword3" class="col-md-1 col-xs-4 control-label" style="padding:0;">
							   发送人：
						  </label>
						  <div class="input-group col-sm-3 col-xs-4" style="padding:0;">
						
							<?php if ($this->_tpl_vars['family_name']['0'] != ""): ?>
								<?php $_from = $this->_tpl_vars['family_name']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
								   <label class="choice"><input type="radio" name="notice_form" value="<?php echo $this->_tpl_vars['value']; ?>
"> <?php echo $this->_tpl_vars['value']; ?>
</label>
								<?php endforeach; endif; unset($_from); ?>
							<?php endif; ?>
							   <label class="choice"><input type="radio" name="notice_form" value="0"><?php echo $this->_tpl_vars['student_data']['student_name']; ?>
</label>
							
						  </div>
				    </div>

				</div><!--box-body -->
				<div id="hiddenBox"></div>
                <div class="box-footer text-center">
                    <button type="submit" class="btn btn-primary " onclick="c();"> 保 存</button>
                </div>
             </form>
           </div><!--box box-default box-solid-->
        </section>   
           
        </div><!--row-->
    </section>
 </div>
  <!--主要内容结束-->
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.footer.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<script src="static/js/jquery.ztree.core.js"></script><!--树形-->
<script src="static/js/jquery.ztree.excheck.js"></script><!--树形-->
<script>
 $(function() {
	$("#student1").hide();	
	$("#jiao1").hide();
    $("#student").click(function(){
		 $("#student1").toggle();			
		});
    $("#jiao").click(function(){
		 $("#jiao1").toggle();			
		});
    })
</script>
<script>
 $(function() {
    $( "#datepicker" ).datetimepicker({
	  timeFormat: "HH:mm",
      showOtherMonths: true,
      selectOtherMonths: true,
	  changeMonth: true,
      changeYear: true,   
    });
	 $( "#date" ).datetimepicker({
	  timeFormat: "HH:mm",
      showOtherMonths: true,
      selectOtherMonths: true,
	  changeMonth: true,
      changeYear: true,   
    });
 })
</script>



<script type="text/javascript" src="static/xhe/xheditor-1.2.2.min.js"></script>
<script type="text/javascript" src="static/xhe/xheditor_lang/zh-cn.js"></script>
<script type="text/javascript">
$(pageInit);
function pageInit()
{
	$.extend(XHEDITOR.settings,{shortcuts:{'ctrl+enter':submitForm}});//修改默认设置
	$('#category_content').xheditor({modalWidth:700,modalHeight:500,upBtnText:'浏览',upLinkUrl:"!ckfinder/upload.html",upImgUrl:"!ckfinder/upload.html?type=Images",upFlashUrl:"!ckfinder/upload.html?type=Flash",upMediaUrl:"!ckfinder/upload.html"});
}
function submitForm(){$('#myform').submit();}
</script>


<script>
     var setting = {
            check: {
                enable: true
            },
            view:{
                showIcon:false
            },
              
            data: {
                simpleData: {
                    enable: true
                }
            }
        };
        var ztNodes =[
		    { id:"g0", pId:0, name:"全体教师"},
			{ id:"g1", pId:"g0", name:"部门"},
			<?php $_from = $this->_tpl_vars['department_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
				{ id:"bm_<?php echo $this->_tpl_vars['value']['department_id']; ?>
", pId:"g1", name:"<?php echo $this->_tpl_vars['value']['department_name']; ?>
", },
			<?php endforeach; endif; unset($_from); ?>			
			<?php $_from = $this->_tpl_vars['department_name']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
				{ id:"user_<?php echo $this->_tpl_vars['value']['user_id']; ?>
", pId:"bm_<?php echo $this->_tpl_vars['value']['department_id']; ?>
", name:"<?php echo $this->_tpl_vars['value']['staff_name']; ?>
", },
			<?php endforeach; endif; unset($_from); ?>
			{ id:"g2", pId:"g0", name:"教研组"},
			<?php $_from = $this->_tpl_vars['research_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
				{ id:"xka_<?php echo $this->_tpl_vars['value']['research_id']; ?>
", pId:"g2", name:"<?php echo $this->_tpl_vars['value']['research_name']; ?>
", },
			<?php endforeach; endif; unset($_from); ?>
			<?php $_from = $this->_tpl_vars['research_name']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
				{ id:"user_<?php echo $this->_tpl_vars['value']['user_id']; ?>
", pId:"xka_<?php echo $this->_tpl_vars['value']['research_id']; ?>
", name:"<?php echo $this->_tpl_vars['value']['staff_name']; ?>
", },
			<?php endforeach; endif; unset($_from); ?>
			{ id:"g3", pId:"g0", name:"备课组"},
			<?php $_from = $this->_tpl_vars['prepare_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
				{ id:"xkb_<?php echo $this->_tpl_vars['value']['prepare_id']; ?>
", pId:"g3", name:"<?php echo $this->_tpl_vars['value']['prepare_name']; ?>
", },
			<?php endforeach; endif; unset($_from); ?>
			<?php $_from = $this->_tpl_vars['prepare_name']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
				{ id:"user_<?php echo $this->_tpl_vars['value']['user_id']; ?>
", pId:"xkb_<?php echo $this->_tpl_vars['value']['prepare_id']; ?>
", name:"<?php echo $this->_tpl_vars['value']['staff_name']; ?>
", },
			<?php endforeach; endif; unset($_from); ?>
			{ id:"g4", pId:"g0", name:"学科组"},
			<?php $_from = $this->_tpl_vars['discipline_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
				{ id:"xkc_<?php echo $this->_tpl_vars['value']['discipline_id']; ?>
", pId:"g4", name:"<?php echo $this->_tpl_vars['value']['discipline_name']; ?>
", },
			<?php endforeach; endif; unset($_from); ?>
			<?php $_from = $this->_tpl_vars['discipline_name']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
				{ id:"user_<?php echo $this->_tpl_vars['value']['user_id']; ?>
", pId:"xkc_<?php echo $this->_tpl_vars['value']['discipline_id']; ?>
", name:"<?php echo $this->_tpl_vars['value']['staff_name']; ?>
", },
			<?php endforeach; endif; unset($_from); ?>
			
];
        var ztcode;
        function setCheck1() {
            var zTree = $.fn.zTree.getZTreeObj("tree2"),
            py = $("#py").attr("checked")? "p":"",
            sy = $("#sy").attr("checked")? "s":"",
            pn = $("#pn").attr("checked")? "p":"",
            sn = $("#sn").attr("checked")? "s":"",
            type = { "Y":py + sy, "N":pn + sn};
            zTree.setting.check.chkboxType = type;
            showCode('setting.check.chkboxType = { "Y" : "' + type.Y + '", "N" : "' + type.N + '" };');
        }
        function showCode1(str) {
            if (!ztcode) ztcode = $("#ztcode");
            ztcode.empty();
            ztcode.append("<li>"+str+"</li>");
        }
        $(document).ready(function(){
            $.fn.zTree.init($("#tree2"), setting, ztNodes);
            setCheck1();
            $("#py").bind("change", setCheck1);
            $("#sy").bind("change", setCheck1);
            $("#pn").bind("change", setCheck1);
            $("#sn").bind("change", setCheck1);
        });
</script>


<script type="text/javascript">
		var setting = {
			check: {
				enable: true,	
			},
			data: {
				simpleData: {
					enable: true
				}
			}
		};
		var zNodes =[
		{ id:"b0", pId:0, name:"全体学生", },
		<?php $_from = $this->_tpl_vars['grade_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
			{ id:"g_<?php echo $this->_tpl_vars['key']; ?>
", pId:"b0", name:"<?php echo $this->_tpl_vars['value']; ?>
", open:true},
		<?php endforeach; endif; unset($_from); ?>
		<?php $_from = $this->_tpl_vars['class_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
			{ id:"c_<?php echo $this->_tpl_vars['value']['class_id']; ?>
", pId:"g_<?php echo $this->_tpl_vars['value']['grade_id']; ?>
", name:"<?php echo $this->_tpl_vars['value']['class_name']; ?>
", open:true},
		<?php endforeach; endif; unset($_from); ?>
		<?php $_from = $this->_tpl_vars['student_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
			{ id:"user_<?php echo $this->_tpl_vars['value']['user_id']; ?>
", pId:"c_<?php echo $this->_tpl_vars['value']['class_id']; ?>
", name:"<?php echo $this->_tpl_vars['value']['student_name']; ?>
", <?php if ($this->_tpl_vars['value']['is_check'] == '1'): ?>checked:true,<?php endif; ?> open:true, last:true},
		<?php endforeach; endif; unset($_from); ?>
		];
		var code;
		
		function setCheck() {
			var zTree = $.fn.zTree.getZTreeObj("treeDemo"),
			py = $("#py").attr("checked")? "p":"",
			sy = $("#sy").attr("checked")? "s":"",
			pn = $("#pn").attr("checked")? "p":"",
			sn = $("#sn").attr("checked")? "s":"",
			type = { "Y":py + sy, "N":pn + sn};
			zTree.setting.check.chkboxType = type;
			showCode('setting.check.chkboxType = { "Y" : "' + type.Y + '", "N" : "' + type.N + '" };');
		}
		function showCode(str) {
			if (!code) code = $("#code");
			code.empty();
			code.append("<li>"+str+"</li>");
		}
		$(document).ready(function(){
			$.fn.zTree.init($("#treeDemo"), setting, zNodes);
			setCheck();
			$("#py").bind("change", setCheck);
			$("#sy").bind("change", setCheck);
			$("#pn").bind("change", setCheck);
			$("#sn").bind("change", setCheck);
		});
function c()
{
	var delidID = "";
	var zTree = $.fn.zTree.getZTreeObj("treeDemo").getCheckedNodes(true);//获取所有选中状态的节点  
	for (var i = 0; i < zTree.length; i++) {  
		//delidID += zTree[i].id + ",";
		$("#hiddenBox").append('<input type="hidden" name="pid[]" value="'+zTree[i].id+'">');
	}
	var zTree = $.fn.zTree.getZTreeObj("tree2").getCheckedNodes(true);//获取所有选中状态的节点  
	for (var i = 0; i < zTree.length; i++) {  
		//delidID += zTree[i].id + ",";
		$("#hiddenBox").append('<input type="hidden" name="pid[]" value="'+zTree[i].id+'">');
	}
} 		
</script>